#! /bin/sh
#cd openapi-rest

if [ -f pid ];then
 cat pid | xargs kill -9
 echo 'app has been killed.'
fi

export YARN_CONF_DIR=/etc/hadoop/conf
export SPARK_YARN_JARS='hdfs://node1:8020/spark/*.jar'
export HADOOP_USER_NAME=hdfs

nohup java -cp .:/etc/hadoop/conf:stat-service-rest/stat-service.jar:stat-service-rest/libs/*  com.ir.stat.spark.StatBoot --server.port=8889 &

echo $! > pid

if [ -f nohup.out ];then
 tail -f nohup.out
fi